package com.ruoyi.wzgl.grlyckcx.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.wzgl.grlyckcx.domain.Grlyckcx;
import com.ruoyi.wzgl.grlyckcx.service.IGrlyckcxService;
import com.ruoyi.wzgl.wzck.domain.Wzck;
import com.ruoyi.wzgl.wzxx.domain.CkHjFcVo;
import com.ruoyi.wzgl.wzxx.domain.WzHkVo;
import com.ruoyi.wzgl.wzxx.domain.Wzxx;
import com.ruoyi.wzgl.wzxx.service.IWzxxService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * 个人领用出库查询Controller
 *
 * @author huacai
 * @date 2024-12-10
 */
@RestController
@RequestMapping("/wzgl/grlyckcx")
public class GrlyckcxController extends BaseController {
    @Resource
    private IGrlyckcxService grlyckcxService;

    /**
     * 查询个人领用出库列表
     */
    @GetMapping("/selectGrLyCkList")
    public TableDataInfo selectGrLyCkList(Grlyckcx grlyckcx) {
        startPage();
        List<Grlyckcx> list = grlyckcxService.selectGrLyCkList(grlyckcx);
        return getDataTable(list);
    }

    /**
     * 导出个人领用出库列表
     */
    @Log(title = "个人领用出库列表", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Grlyckcx grlyckcx) {
        List<Grlyckcx> list = grlyckcxService.selectGrLyCkList(grlyckcx);
        ExcelUtil<Grlyckcx> util = new ExcelUtil<Grlyckcx>(Grlyckcx.class);
        util.exportExcel(response, list, "个人领用出库列表", "个人领用出库查询列表");
    }

}
